

import type { Icategory } from './entity';
import type { IPageParams } from '@/types/table'
import request from '@/api/request'

export function getPageList(params: IPageParams) {
  return request({
    url: `admin/category/list`,
    method: 'get',
    params,
    loading: true
  })
}

export function categoryDel(id) {
  return request({
    url: `admin/category/delete`,
    method: 'get',
    params: { id }
  })
}
export function categoryinfo(id) {
  return request({
    url: `admin/category/info`,
    method: 'get',
    params: { id }
  })
}
export function categorySelect(id) {
  return request({
    url: `admin/category/select`,
    method: 'get'
  })
}

export function categoryAddup(data) {
  return request({
    url: `admin/category/${!data.id ? 'save' : 'update'}`,
    method: 'post',
    params: data
  })
}
